Configuration
The config file may look repulsive but don't worry it's not that complicated. We will go through it step by step.
Config = {}
Config.Framework = 'qbcore' --currently supported options: 'qbcore'
Config.MaxCachedHarvestedPlants = 2
Config.Debug = false
Config.MaterialNames = {
[0x46CA81E8] = "Concrete",
[0x1567BF52] = "ConcretePothole",
[0x962C3F7B] = "Default",
[0x1356F51D] = "Tarmac",
[0x1F1F680C] = "TarmacPothole",
[0x4F747B87] = "Grass",
[0xB34E900D] = "GrassShort",
[0x92B69883] = "Hay",
[0x8F9CD58F] = "DirtTrack",
[0xAB04871D] = "Dirt",
[0xEABD174E] = "GravelDeep",
[0x72C668B6] = "GravelTrainTrack",
[0x2E302E4A] = "Gravel",
[0x3F8E2C63] = "Sand",
[0x1683F2C4] = "SandCompact",
[-700658213] = "GrassVineyard1",
[223086562] = "GrassMarsh1", --The March near the fort
[-1942898710] = "DirtField1",
[1109728704] = "DirtField2",
[0x2883F52E] = "Water",
[0x67382C28] = "Pavement",
[0x11924B63] = "Brick",
[0x52E8052F] = "Marble",
[0x25E11B98] = "Wood",
[0x87171988] = "Metal",
[0x78771988] = "Glass",
[0x36411988] = "Carpet",
[0x98121988] = "Tile",
[0x45221988] = "Paper",
[0x12341988] = "Plaster",
[0x77551988] = "Rubber",
[0x99881988] = "Plastic",
}
Config.Plants = {
['ip_weed_seed'] = {
label = 'Cannabis',
hasOwner = true, --set to true if this plant should only be accesable by the creator of the plant
--stages = 3,
timePerStage = 10000, --Time in milliseconds (1000 milliseconds = 1 second)
--seedItem = 'weed_seed',
props = {
'prop_weed_02',
'prop_weed_01'
},
harvestedItem = 'ip_weed',
min = 1, --the minimum of harvestedItem you can get
max = 5, --the maximum of harvestedItem you can get
itemToHarvest = false, --can be false or true if you need an item to harvest this plant (not implemented yet!)
--grounds defines wich grounds are ok to plant the plant on
grounds = {
0x4F747B87,
0xB34E900D,
0xAB04871D,
-700658213,
223086562,
-1942898710,
1109728704,
},
waterConsumptionRate = 1.0,
waterThreshold = 40.0, --minimum needed water to stage up to next prop/grow state
survivalThreshold = 15.0, --minimum needed water to ensure that timeTilNextStage timer on the server main loop keeps decrementing
target = {
--offset = vec3(0., 0.0, 0.0),
size = vector3(1.5, 1.5, 1.5)
}
}, ...
Config.WateringItems = {
['water'] = 20.0,
}
The table Config.MaterialNames
So a MaterialName in this case is basicly just a material you can plant your plant on like:
- Grass
- Dirt
- Or even asphalt if you want
So for example we take the ground material Grass
[0x4F747B87] = "Grass",
If you want to add Grass to ur own or an existing plant you but the value 0x4F747B87 into the list grounds. Like this:
Config.Plants = {
['ur_custom_seed'] = {
grounds = {
0x4F747B87, -- the Material grass
}
}
}
The table Config.WateringItems
This table contains items that can be used for watering plants. Note that the key in brackets is the name of the ìtem and the value is how mutch water it will add to the plant.
The table Config.Plants
As your learned a few lines above you can create your own plants/seeds or customize existing ones in this table so I will explain the options to you. In the end, it's pretty self-explanatory so to create a new seed you need to put the name of the seed item, the item you use to plant the seed, in the first brackets. To learn how to create items for ox_inventory, it’s best to have a look at the official documentation here.
['ur_custom_seed']
When you added ur item to the ìtems.luain the ox_inventory folder it is importend that you add this line in the client section:
event = 'indigo_planting:client:useSeed'
so that it looks like this:
['ip_wheat_seed'] = {
label = 'wheat seed',
weight = 5,
stack = true,
close = true,
client = {
image = 'ip_wheat_seed.png',
usetime = 2500,
event = 'indigo_planting:client:useSeed'
},
},
Without the indigo_planting:client;useSeed event it won't work.
After that, you can specify the plant's characteristics.